define(["dojo/dom", "dojo/_base/window", "dojo/json", "dojo/request", "dojo/ready", "dijit/form/MultiSelect",
    "dojo/_base/declare", "dojo/parser", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/registry"], 
    function(dom, win, JSON, request, ready, MultiSelect, declare, parser, _WidgetBase, _TemplateMixin, registry) {
        return declare("my.createAttributes", [_WidgetBase, _TemplatedMixin], {
            templateString: 
                "<div>" +
                "<div data-dojo-type='dijit/form/MultiSelect' style='height: 100%; width:100%;'></div>" +
                "</div>",
            });

            ready(function() {
                parser.parse();
                request.post("attributes",{
				    handleAs: "json"}).then(function(data){
					    for(var i = 0; i < data.length; i++){
						    column = data[i];
						    var attr = dom.byId('attributes');
						    var c = win.doc.createElement('option');
						    c.innerHTML = column[0];
						    c.value = column[1];
						    attr.appendChild(c);
					    }
				    }
                );
            });

    }
);

